UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2uPmPbAcWCoTDyTYXScSLATTsM1g4tTwMBesCQk+uLo='
WHERE
key_id = '3338119ecd49ae8d27188db4938ef6ade5641a0f668b22fc3d22fa08c5e67505'
AND (
token = '2uPmPbAcWCoTDyTYXScSLATTsM1g4tTwMBesCQk+uLo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)