UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w4BNnyoB01SWLhr4iBtueKobpsMU9SPMuiK7zarjS30='
WHERE
key_id = 'dedb98d2508654a81651db35d867376cef0a00b21827a4936ed40852332fb12a'
AND (
token = 'w4BNnyoB01SWLhr4iBtueKobpsMU9SPMuiK7zarjS30='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)