UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/JyhNi0/ywetL3QhrnJozVO25ZhLaTR4FbcxBEoMnMU=' 
WHERE 
  key_id = '0b87bf32e9ceff3ee81f50d082f2d53dacc4b7c2ecfda65bbc3b731265b9d727' 
  AND (
    token = '/JyhNi0/ywetL3QhrnJozVO25ZhLaTR4FbcxBEoMnMU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031