UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wv0hI1KCFsbYKoOcJxjkB2bDlroPrfgYUDuSZr0XKJY=' 
WHERE 
  key_id = '3bed71174e902f26a0a63bf0326b02873ae97509ab4a135855a6223134d51ebc' 
  AND (
    token = 'wv0hI1KCFsbYKoOcJxjkB2bDlroPrfgYUDuSZr0XKJY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031