UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xL8stI2t19jqGnj2uLN4eqO5twMIoK6+VX1sa2vj3NM=' 
WHERE 
  key_id = 'b3b89c154e15a726d31d971f1695209725aa183b7b67b8f132d6b0e6483473fc' 
  AND (
    token = 'xL8stI2t19jqGnj2uLN4eqO5twMIoK6+VX1sa2vj3NM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033