UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ze6LQyAsw9DX4LeQjWgXoNZ1emHGeyYNqgcW7DYQoYk='
WHERE
key_id = '920fec50fceb60e7bcb785f98bd4a90f6b4c181ac8e09c5d2b33691f8c2e2463'
AND (
token = 'Ze6LQyAsw9DX4LeQjWgXoNZ1emHGeyYNqgcW7DYQoYk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)