UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n/AxPACeGbJbmRY1B7Ozn3F4lpT6ZlN+fzaqU4/6A1U='
WHERE
key_id = 'fbb0b977c360e9f0747e7ca0ad657cc4e6480fc6424bcee541710c75d81b7e52'
AND (
token = 'n/AxPACeGbJbmRY1B7Ozn3F4lpT6ZlN+fzaqU4/6A1U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)