UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+P7mzYCbW0H2FEhjmMKF8CLW7fmQhcJ2MtlpXSJvJ8I=' 
WHERE 
  key_id = '98880c0786af3ade310c0bf0bf51a8aec16ea9399e907c88abf46c72706dc5c0' 
  AND (
    token = '+P7mzYCbW0H2FEhjmMKF8CLW7fmQhcJ2MtlpXSJvJ8I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021