UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ebrROxfaAo4RLU0axbsYI7acact227tiFrQJBNWtUI4=' 
WHERE 
  key_id = '4f68b2cf6356cb50677fdd4361efa421e75dce3ea5998ce39fb96412637ef35e' 
  AND (
    token = 'ebrROxfaAo4RLU0axbsYI7acact227tiFrQJBNWtUI4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053