UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nuLksMW1GfZm49Sgdm2ozobERr2xmMWHB8ojCJHZRkU=' 
WHERE 
  key_id = '7a34e4356154df15dc5f748f5e9462ade922181e47db49c325be5e7b6b6d4a5b' 
  AND (
    token = 'nuLksMW1GfZm49Sgdm2ozobERr2xmMWHB8ojCJHZRkU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047