UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3onk7l51azhxFYNj1K5zyfssxtVX1PgtwlLQ9UxVV6Q=' 
WHERE 
  key_id = '2d1d4d3030c65b52283f79abc833af354e73151ee9ed2eba2902ba12c143b307' 
  AND (
    token = '3onk7l51azhxFYNj1K5zyfssxtVX1PgtwlLQ9UxVV6Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023