UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Eqa1zGiZ760PTgAk+G5uO6CBIRrHRshoatGHNIvR3gQ=' 
WHERE 
  key_id = 'e577471d648816a79ef8d6e333d124e3c3ad8a06ebd2cb21ece4637e287ab802' 
  AND (
    token = 'Eqa1zGiZ760PTgAk+G5uO6CBIRrHRshoatGHNIvR3gQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036