UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kb/cllG3nkv9+HTtys3FlV51fYVEHw66UzBBVuD0j7c='
WHERE
key_id = 'd153ff9b58be0c71582b1c09902aa1dec78db9057e437eb174caf49203a3f814'
AND (
token = 'kb/cllG3nkv9+HTtys3FlV51fYVEHw66UzBBVuD0j7c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)