UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hORPyOKEpzTBRQUfMP9qd5i9rhrx/o8LESieoMdnGfA=' 
WHERE 
  key_id = '62a8d5385e5b4eae731157889922efb013962352db87b5ad7ef69a6daab519e5' 
  AND (
    token = 'hORPyOKEpzTBRQUfMP9qd5i9rhrx/o8LESieoMdnGfA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00070