UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z9/bpr4MrGM0tqU3ArFk1CAVKjVExPMuwCIwm2JhgRs='
WHERE
key_id = '30dd49ddd9a2adf2adc9ab495ccc701e370f13e1f4e9abd9906dee04c9fffee9'
AND (
token = 'z9/bpr4MrGM0tqU3ArFk1CAVKjVExPMuwCIwm2JhgRs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)