UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QaiTWGLYsOzV7ZrOmjD4er6wkhym+mLpUy3aTOvr1F4='
WHERE
key_id = 'e537feec09941c0ebe4cbd5cb180190332da19cc69597b4d9aeacd6959892385'
AND (
token = 'QaiTWGLYsOzV7ZrOmjD4er6wkhym+mLpUy3aTOvr1F4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)