UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'puufEIdWvJM68vkCQDTt2tvsE+R3/YMR4HxQxqr/4oc=' 
WHERE 
  key_id = 'cc919fd66d39a85447ebf2f864fa218b712c4efbb7798af5eb9213e19a3e6ce1' 
  AND (
    token = 'puufEIdWvJM68vkCQDTt2tvsE+R3/YMR4HxQxqr/4oc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036