UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n/zWodJoKPdAufBvjh21YN+wlzwt2YsnNOx/fR1YB3g='
WHERE
key_id = '591abe7c681d6165fd170f7b6e250e00e64d40356632a0ec4398a00e1c5021f1'
AND (
token = 'n/zWodJoKPdAufBvjh21YN+wlzwt2YsnNOx/fR1YB3g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)