UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xvERbCgEVwIWbtxPpVothpfUI8T5PqTpCuRFTga5tUk=' 
WHERE 
  key_id = 'f26d8a53a9a3f4191c02d24b03b0da48b5b699bc4a69e083c76d1563e6884675' 
  AND (
    token = 'xvERbCgEVwIWbtxPpVothpfUI8T5PqTpCuRFTga5tUk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038