UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z8rjLOrZOq/o22s2BeOaJ54/v3biUXa13yoZXEaVf2E='
WHERE
key_id = '584cc33af31787833fa866590ddfe4e39c832aefbf15e4be3b9882cc125b1cbf'
AND (
token = 'Z8rjLOrZOq/o22s2BeOaJ54/v3biUXa13yoZXEaVf2E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)