UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iZsq3BD1o1ld24L/UBqefxL7WwS9MsqG9N08mR3IG48='
WHERE
key_id = '8e136879331208fecf91a77a03bc3fdcb2e805ded6e2a639ee618db67e65ecaa'
AND (
token = 'iZsq3BD1o1ld24L/UBqefxL7WwS9MsqG9N08mR3IG48='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)