UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'azbE/SV4M5uChUuW9lmdsDWlVfGkOBonSzrnnmXOfOA='
WHERE
key_id = '7b896e2e82f6054c609c93dcf30a5c24fa83b6f56c6dadfdfdaad301a25d0a0c'
AND (
token = 'azbE/SV4M5uChUuW9lmdsDWlVfGkOBonSzrnnmXOfOA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)