UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nTplRyRqtytvcaw+8iFhg+2Qv9AX/Cq0WAVRUJDvIo8='
WHERE
key_id = '5b2fbda8e0bf69f3cc4af17286aea76dc1e617c7d671e0e472d2edeef8e8e76a'
AND (
token = 'nTplRyRqtytvcaw+8iFhg+2Qv9AX/Cq0WAVRUJDvIo8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)