UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qQjQG0pshjl1KzHxdLQzqpxrzoXjEOqvTZABJpzQ/Y8='
WHERE
key_id = '66acd3c4045c97dabdcfbb97623f970d29e03517ab7c4450b7ba931320606fd7'
AND (
token = 'qQjQG0pshjl1KzHxdLQzqpxrzoXjEOqvTZABJpzQ/Y8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)