UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ngGCX2HGMDo+20yVb17I8IgBRj5E+V4ZG9kS3Z6eGYE='
WHERE
key_id = 'bd3ff6ddea62b9c1a3e13ba63d485c683620ca17dcca68db4f885cf89bb88625'
AND (
token = 'ngGCX2HGMDo+20yVb17I8IgBRj5E+V4ZG9kS3Z6eGYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)