UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NLvkyehRI1/9YZG69XJ8nx3lyqD6qCxmElxHNoGrumU='
WHERE
key_id = 'da4411671331528ff1c536558e8710863a534524458a603eb18d074661936803'
AND (
token = 'NLvkyehRI1/9YZG69XJ8nx3lyqD6qCxmElxHNoGrumU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)