UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rZOM8rht7ZQ6UBZ1AqifBN8u5oCR0p3S6HEURrPY4Fg='
WHERE
key_id = '5418c3465bdc498579ff6542ab899761e8c81e7cc2723cab4aedfdad951dfa30'
AND (
token = 'rZOM8rht7ZQ6UBZ1AqifBN8u5oCR0p3S6HEURrPY4Fg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)