UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E6DT6nABeu3kek8R6lwNfKem9JlRvBAxMtfPcy5sZqk='
WHERE
key_id = 'feed7dd12a34e042e89dfa06a6dff5c1cc4f0e59efd28bd7eda6aafc2ce50e91'
AND (
token = 'E6DT6nABeu3kek8R6lwNfKem9JlRvBAxMtfPcy5sZqk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)