UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5br6Ykh8Bo84I49vGb6jsl5Bx+LSvWJwaEFUc1cTJeU=' 
WHERE 
  key_id = '454a45b0f745b1a89f77d0856b1828afd73fc3cd041c38bb266820e7d55baa4e' 
  AND (
    token = '5br6Ykh8Bo84I49vGb6jsl5Bx+LSvWJwaEFUc1cTJeU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021