UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '25edvCQtFeeMLB1wTONJDGVgvRccj92qzaBxPjCjZUI='
WHERE
key_id = 'c30d66985e9542df99ddb70e46af85660b2616aed454366ea329b88c5437457f'
AND (
token = '25edvCQtFeeMLB1wTONJDGVgvRccj92qzaBxPjCjZUI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)