UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y4wImTnIA1bh+BZW1P8KeRbVgtx9SUir0gLJrUM5VxI='
WHERE
key_id = 'e3dc5774ab8cca5887621ca5bd755bb20224461c594f8686ddc0716b31c31033'
AND (
token = 'Y4wImTnIA1bh+BZW1P8KeRbVgtx9SUir0gLJrUM5VxI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)