UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2V/sYpLb9Gr7VFEnaJ24qXdOfzyYqLfLDNVsamb4HAc='
WHERE
key_id = '7d6568c6b71f2bf4046e2593409b925d815ab6ce096962855561c87fd982018d'
AND (
token = '2V/sYpLb9Gr7VFEnaJ24qXdOfzyYqLfLDNVsamb4HAc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)