UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5uHK7NbWBCokCPfDbP4HwFwhEV14cI9JoGJ6dOSDpKs='
WHERE
key_id = 'f4eff65087167d2d7a7e7ec235c8af362e542969452f2830c831c00847711ccb'
AND (
token = '5uHK7NbWBCokCPfDbP4HwFwhEV14cI9JoGJ6dOSDpKs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)