UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UMAJOHaUry0/0lrfSSmJGYHdSuKXEybAu/n0L/dshXk=' 
WHERE 
  key_id = '0c1155c845e2a729af91e1bf1c4e88a148447ae2c8ae1a4919888797ca99449d' 
  AND (
    token = 'UMAJOHaUry0/0lrfSSmJGYHdSuKXEybAu/n0L/dshXk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020