UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uTkD11eEeFBxGgguEJj/Nmk3P0VT+JX6/+4z9vhwk8Q=' 
WHERE 
  key_id = 'ec218e4eb516fb60a7027e5839115479b3c47239c4fda3d515dad38735bbcd20' 
  AND (
    token = 'uTkD11eEeFBxGgguEJj/Nmk3P0VT+JX6/+4z9vhwk8Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054