UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lojEhG+wHSEqea6B8mHAT+nYWL3XaoKHgAsGnl8xQLY='
WHERE
key_id = '73eaf77a8fc6abcd0707cc19e757a0e37b777c6d80217af95d2c9c021bde8669'
AND (
token = 'lojEhG+wHSEqea6B8mHAT+nYWL3XaoKHgAsGnl8xQLY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)