UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lnjwChEvF1v1QyqxX8u45+NMXkNs7BIkci3yMRhnPAA='
WHERE
key_id = 'faecf919777e6d5f2b209bc59334afa0def6110e27cb48260645dce8aec1a25e'
AND (
token = 'lnjwChEvF1v1QyqxX8u45+NMXkNs7BIkci3yMRhnPAA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)