UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3RjP+PHwAypTUUTnWxAs9ofK96LeBJUsXI8STbdbots='
WHERE
key_id = '325f5120a15c920e86ff0c62b1ecd56cf909f96a11dbf5368f81c158418d943b'
AND (
token = '3RjP+PHwAypTUUTnWxAs9ofK96LeBJUsXI8STbdbots='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)