UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BN4pwagR42MYjWf2C/AjV1aE3zHJ6Lx4KfiJQpPisqU=' 
WHERE 
  key_id = 'd60d937a0072727a4864aaa4ce446839c8dad6fb75026e70a1a5c8699adf9790' 
  AND (
    token = 'BN4pwagR42MYjWf2C/AjV1aE3zHJ6Lx4KfiJQpPisqU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050