UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gSd2VBP/oxjblgZ0oUNWB3kaEGzWY5axCC7lOEOuiUU=' 
WHERE 
  key_id = '8f0f4f395486a0fde70fb526eec9984dc693943af133a7fd9c7ef4af4520b8e4' 
  AND (
    token = 'gSd2VBP/oxjblgZ0oUNWB3kaEGzWY5axCC7lOEOuiUU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041