UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YhYtNIZnxQpKPmEmvi6eEAtD6LJ0UL1FX1LzAbytPJQ=' 
WHERE 
  key_id = '0435a170cdbcae59bccb411e8a22570edceeb25be369375655c748a247bb4d35' 
  AND (
    token = 'YhYtNIZnxQpKPmEmvi6eEAtD6LJ0UL1FX1LzAbytPJQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029