UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zXv9Is3C/rkSwpyI8hzNjOaxVQGixVoXLbda5Kegv7s=' 
WHERE 
  key_id = '24e958479ae37143b7091c3253eb2ca8e9fccc4c6b396cf25f42583e513e2f2c' 
  AND (
    token = 'zXv9Is3C/rkSwpyI8hzNjOaxVQGixVoXLbda5Kegv7s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030