UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AxLQAxT6jX5kw8XcHvLkeyWjeRaO0xHFkpxCy5+0bA0='
WHERE
key_id = 'b35a1a3e1bacec7315c68378a3cafb7be86da86dc144070479560d0c86379106'
AND (
token = 'AxLQAxT6jX5kw8XcHvLkeyWjeRaO0xHFkpxCy5+0bA0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)