UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mbfsQwStTZn+PitxA8+5Gxg1FRSWfCCnfgzc05w0qUg='
WHERE
key_id = '81a7fd88da8fa60b3937c7521e52b7119c34875fe0c48cb73d4085ceb12eba59'
AND (
token = 'mbfsQwStTZn+PitxA8+5Gxg1FRSWfCCnfgzc05w0qUg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)