UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xSeZ/xhBK07y7Dt69UteuvB5VTgi1vn6AYG7Q9K2DEo=' 
WHERE 
  key_id = 'fd79df0a0979c24d07d78dcc1f926edc14dc6a52836af450e641069e097d9605' 
  AND (
    token = 'xSeZ/xhBK07y7Dt69UteuvB5VTgi1vn6AYG7Q9K2DEo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033