UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2aed5q9jPZUhfex6WyvGCG9vdr3Gc00ttBWMCaQgtac='
WHERE
key_id = '7aae82fd6b9323f1528725b862d7231afcea562a88fe79fc84681b7e5930c285'
AND (
token = '2aed5q9jPZUhfex6WyvGCG9vdr3Gc00ttBWMCaQgtac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)