UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nvGLYf2H1xW3q/dpGandGR/7bcvtvdADE/uMxBAYY+k='
WHERE
key_id = 'ee25e75b6b5b4c64c9724eefe9fd7abba140ba84defa8ee4d3825fe2cd131098'
AND (
token = 'nvGLYf2H1xW3q/dpGandGR/7bcvtvdADE/uMxBAYY+k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)