UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yeLN4MXJXOlqw+WQKxMHmIJhVlVvXTPg3fXwaKgL7Ow='
WHERE
key_id = 'fdb3f6ec42cf319f34ee4d8d1ad7f313f647e7ff0b069224200baa9bc47e080c'
AND (
token = 'yeLN4MXJXOlqw+WQKxMHmIJhVlVvXTPg3fXwaKgL7Ow='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)