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