UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1/kWZNxtT3RabIsOgz4rNMazm7B3ZTNweN7xQO362xU='
WHERE
key_id = 'c5748db37a4a86facd24b36ef1fc7971e4811b5f776bbb4881f49dd108207f04'
AND (
token = '1/kWZNxtT3RabIsOgz4rNMazm7B3ZTNweN7xQO362xU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)