UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VQsYrnP4oDJm79ErywW/DtJWivhBzahXxb3m1xEDXaI='
WHERE
key_id = '31e755c194f00b9d3992afce5c6ed8e1386b14d6ac6e786f414e50da7821b0ff'
AND (
token = 'VQsYrnP4oDJm79ErywW/DtJWivhBzahXxb3m1xEDXaI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)