UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0Y84/0ipAGC2Dj9NTDKCVCqV//Mt5mwor9Bqy3zQtGg='
WHERE
key_id = '49dd0313771d176c6a939210942c585d5c5536881a205b7cd2eeecbc95d072f6'
AND (
token = '0Y84/0ipAGC2Dj9NTDKCVCqV//Mt5mwor9Bqy3zQtGg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)