UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6D0aqbY5fpnsaqTlFRg//uw0xtsvWxq2CYGMGR67lP4='
WHERE
key_id = 'c3c576a45a96a892399e847ef612f672413f946fe5e40921cb017e775d959d36'
AND (
token = '6D0aqbY5fpnsaqTlFRg//uw0xtsvWxq2CYGMGR67lP4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)